package com.raja.requestForwarding.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by dell on 2017/3/21.
 */
@Controller
public class TestController {
    private static final Logger log = LoggerFactory.getLogger(TestController.class);


    @RequestMapping(value = "/user")
    public void getUser(HttpServletResponse response){
        try {
            response.getWriter().write("55555555555555");
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    @RequestMapping("/send")
    public void send(HttpServletResponse response){

        try {
            response.getWriter().write("ok");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    @RequestMapping(value = "welcome")
    public String weilcome(HttpServletRequest request ,HttpServletResponse response){
        request.setAttribute("aa","刘艳军");
        List<String> list = new ArrayList<>();
        list.add("123123");
        list.add("的双丰收");
        request.setAttribute("bb",list);
        System.out.println("123123123123123");
        return "/html/welcome";
    }


}
